$(() => {
    $(`
        <div id="goTop" class="contact">
            <svg
                viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1810">
                <path
                    d="M128 128l768 0 0 89.6-768 0 0-89.6ZM732.288 496 555.7888 309.8624c-10.9504-11.2064-26.4128-18.4896-43.7888-18.4896s-32.832 7.2832-43.6032 18.6048L291.5264 495.8656c-9.2288 10.0224-15.1104 22.9696-15.1104 37.3248 0 30.816 26.3808 55.8016 58.8992 55.8016 0.4544 0 0.896-0.0576 1.344-0.0704l0 0.352L416 589.2736 416 896l192 0L608 589.2736l77.1904 0 0-0.448c1.1648 0.064 2.3104 0.1792 3.5008 0.1792 32.5248 0 58.8992-24.992 58.8992-55.8144C747.5904 518.8352 741.7024 505.8944 732.288 496z"
                    fill="#ffffff" p-id="1811"></path>
            </svg>
            <div>回到顶部</div>
        </div>
    `).appendTo("#contact");

    let top = $(".section").eq(0);

    $("#goTop").on('click', () => {
        if (!top.hasClass("active")) {
            let nowPage = $(".active");
            nowPage.removeClass("active");
            nowPage.removeClass("fp-completely");
            top.addClass("active");
            top.addClass("fp-completely");
            $("#fullpage").css({
                transform: "translate3d(0px, 0px, 0px)"
            })
        }
    });
});